﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;
using System.Windows.Resources;

namespace Sanctuary.Core.Images
{
    public static class ImageFiles
    {
        private static Image GetImage(string fileName, Stretch stretch = Stretch.Fill)
        {
            Image i = new Image();
            StreamResourceInfo sr = Application.GetResourceStream(new Uri("GameContent;component/Images/" + fileName, UriKind.Relative));
            BitmapImage bmp = new BitmapImage();
            bmp.SetSource(sr.Stream);
            i.Source = bmp;
            i.Stretch = stretch;
            return i;
        }

        private static Image SetImage(Image i, string fileName, Stretch stretch = Stretch.Fill)
        {
            StreamResourceInfo sr = Application.GetResourceStream(new Uri("GameContent;component/Images/" + fileName, UriKind.Relative));
            BitmapImage bmp = new BitmapImage();
            bmp.SetSource(sr.Stream);
            i.Source = bmp;
            //i.Stretch = stretch;
            return i;
        }

        public static Image IntroImage
        {
            get
            {
                return GetImage("Intro.jpg");
            }
        }

        public static void SetIntroImage(Image i)
        {
            SetImage(i, "Intro.jpg"); 
        }

        public static Image OfficeImage
        {
            get
            {
                return GetImage("Office.jpg");
            }
        }

        public static void SetOfficeImage(Image i)
        {
            SetImage(i, "Office.jpg");
        }

        public static Image Patriotic
        {
            get
            {
                return GetImage("patriotic.png", Stretch.None);
            }
        }

        public static void SetPatrioticImage(Image i)
        {
            SetImage(i, "patriotic.png");
        }

        public static Image Thought
        {
            get
            {
                return GetImage("thought.png", Stretch.None);
            }
        }

        public static void SetThoughtImage(Image i)
        {
            SetImage(i, "thought.png");
        }

    }
}
